<?php /* Smarty version Smarty-3.1.13, created on 2014-10-29 22:59:49
         compiled from "D:\PHPWeb\cms\templates\admin\users\users.tpl" */ ?>
<?php /*%%SmartyHeaderCode:272395450f3f30157f3-83159358%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'ace6b06503b1008950c45ad84d3194f26ed99c4e' => 
    array (
      0 => 'D:\\PHPWeb\\cms\\templates\\admin\\users\\users.tpl',
      1 => 1414594784,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '272395450f3f30157f3-83159358',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.13',
  'unifunc' => 'content_5450f3f30bf3a1_95377058',
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5450f3f30bf3a1_95377058')) {function content_5450f3f30bf3a1_95377058($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("admin/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>
 <?php echo $_smarty_tpl->getSubTemplate ("admin/navibar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>
 <?php echo $_smarty_tpl->getSubTemplate ("admin/sidebar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<style type="text/css">
#user_integral_show {
	margin: -400px 0 0 -250px;
	/* PLAY THE WITH THE VALUES TO SEE GET THE DESIRED EFFECT */
}

#user_integral_modify {
		margin: -400px 0 0 -250px;
	/* PLAY THE WITH THE VALUES TO SEE GET THE DESIRED EFFECT */
}
</style>

<div class="content">

	<div class="header">
		<div class="stats">
			<p class="stat">
				<!--span class="number"></span-->
			</p>
		</div>

		<h3 class="page-title">注册用户信息管理</h3>
	</div>


	<div class="container-fluid">
		<div class="row-fluid">
			<div class="block">
				<div id="page-menu" class="block-body collapse in">
					<br />
					<form class="form-search" method="post" id="searchform">
						<div class="input-prepend">
							<span class="add-on">用户ID:</span> <input class="input-medium"
								type="text" placeholder="用户的id" name="userid" id="userid"
								style="width: 135px;">
						</div>
						<div class="input-prepend">
							<span class="add-on">邮箱:</span> <input class="input-medium"
								type="text" placeholder="邮箱" name="email" id="email"
								style="width: 135px;">
						</div>
						<div class="input-prepend">
							<span class="add-on">用户名:</span> <input class="input-medium"
								type="text" placeholder="用户名" name="username" id="username"
								style="width: 135px;">
						</div>

						<button type="button" class="btn btn-primary" onclick="search()">查询</button>
						<button type="button" class="btn " onclick="clearSearch()">重置</button>
					</form>
				</div>
			</div>
		</div>
		<div class="block">

			<table id="grid"
				data-options="url:'admin/users/getpage',fitColumns:true,singleSelect:true"
				class="easyui-datagrid" toolbar="#toolbar"
				style="width: auto; height: 350px" iconCls="icon-save"
				pagination="true"　>
				<thead>
					<tr>
						<th data-options="field:'userid',checkbox:true,width:100"></th>
						<th data-options="field:'username',width:100">用户名</th>
						<th data-options="field:'email',width:100">邮箱</th>
						<th data-options="field:'firstname',width:100">姓</th>
						<th data-options="field:'lastname',width:100">名</th>
						<th
							data-options="field:'login_type',width:100,formatter:userlogintypeformat">登陆类型</th>
						<th data-options="field:'user_photo',width:100">用户头像</th>
						<th data-options="field:'birthdate',width:120"
							,formatter="dateTimeFormat">出生日期</th>
						<th data-options="field:'desc',width:100">描述</th>
						<th data-options="field:'level',width:100">等级</th>
						<th data-options="field:'points',width:100">积分</th>
						<th
							data-options="field:'_operate',width:230,align:'center',formatter:formatOper">积分操作</th>
					</tr>
				</thead>
			</table>
			<!--- START 分页模板 --->
			<div id="toolbar">
				<a class="easyui-linkbutton" iconCls="icons-delete" plain="true"
					onclick="removeitem()">删除</a>

			</div>

			<!--- END --->
		</div>


	</div>
<?php echo $_smarty_tpl->getSubTemplate ("admin/users/useredit/user_integral_list.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>
 <?php echo $_smarty_tpl->getSubTemplate ("admin/users/useredit/user_integral_modify.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>


	<!--- END 以下内容不需更改，请保证该TPL页内的标签匹配即可 --->
	<?php echo $_smarty_tpl->getSubTemplate ("admin/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>


	<script type="text/javascript"
		src="<?php echo @constant('WEBSITE_URL');?>
public/js/rmanger.js"></script>
	<script type="text/javascript">

	url = "<?php echo @constant('WEBSITE_URL');?>
"+"admin/users";
	key = "userid";
	function  dateTimeFormat(value, rec, index) {
	    if (value == undefined) {
	        return "";
	    }
	    return value.format("yyyy-mm-dd");
	}

	function userlogintypeformat(value,row,index){
		if(value == 0){
			return "本站登录"; 
		}else if(value == 1){
			return "新浪微博";
		}
		  return "其他登录";
	}
	var Common = {

	    //EasyUI用DataGrid用日期格式化
	    TimeFormatter: function (value, rec, index) {
	        if (value == undefined) {
	            return "";
	        }
	        /*json格式时间转js时间格式*/
	        value = value.substr(1, value.length - 2);
	        var obj = eval('(' + "{Date: new " + value + "}" + ')');
	        var dateValue = obj["Date"];
	        if (dateValue.getFullYear() < 1900) {
	            return "";
	        }
	        var val = dateValue.format("yyyy-mm-dd HH:MM");
	        return val.substr(11, 5);
	    },
	    DateTimeFormatter: function (value, rec, index) {
	        if (value == undefined) {
	            return "";
	        }
	        /*json格式时间转js时间格式*/
	        value = value.substr(1, value.length - 2);
	        var obj = eval('(' + "{Date: new " + value + "}" + ')');
	        var dateValue = obj["Date"];
	        if (dateValue.getFullYear() < 1900) {
	            return "";
	        }

	        return dateValue.format("yyyy-mm-dd HH:MM");
	    },

	    //EasyUI用DataGrid用日期格式化
	    DateFormatter: function (value, rec, index) {
	        if (value == undefined) {
	            return "";
	        }
	        /*json格式时间转js时间格式*/
	        value = value.substr(1, value.length - 2);
	        var obj = eval('(' + "{Date: new " + value + "}" + ')');
	        var dateValue = obj["Date"];
	        if (dateValue.getFullYear() < 1900) {
	            return "";
	        }

	        return dateValue.format("yyyy-mm-dd");
	    }
	};
	function showUserIntegrals(index){
		t_modelshow("user_integral_show");
		loadListPage(index); 
	}
	function addUserIntegral(index){
		var datas = $('#grid').datagrid('getRows');
		t_modelshow("user_integral_modify");
		$("#integralModify").form('clear');
		$("#integral_contype").attr("value","增加积分");
		$("#integralModify_userid").attr("value",datas[index].userid);
		$("#integralModify_username").attr("value",datas[index].username);
		
		$("#integralModify_type").attr("value",0);
	}
	function removeUserIntegral(index){
		t_modelshow("user_integral_modify");
		var datas = $('#grid').datagrid('getRows');
		t_modelshow("user_integral_modify");
		$("#integralModify").form('clear');
		$("#integral_contype").attr("value","减少积分");
		$("#integralModify_userid").attr("value",datas[index].userid);
		$("#integralModify_type").attr("value",1);
	}
	 function t_modelshow(module){ 
		 $('#'+module).modal('show');
	 }
	 function t_modelhide(module){
		 $('#'+module).modal('hide');
	 }
	function formatOper(val,row,index){
		return '<button type="button" class="btn btn-primary" onclick="showUserIntegrals('+index+')">查看</button>'+
		'<button type="button" class="btn btn-primary" onclick="addUserIntegral('+index+')">添加</button>'+
		'<button type="button" class="btn btn-primary" onclick="removeUserIntegral('+index+')">减少</button>';
	}
</script>
<?php }} ?>